/**
 * 通用模板
 */
$(function () {
    var patient = "";
    $.ajax({
        url: "../../QueryFieldAnnotations/selectPtientInformationSheet",
        type: "post",
        dataType: "json",
        success: function (map) {
            /**
             * 基本信息
             */
                //清楚下拉框
            patient = map.patient;
            var htmlstr = "";
            for (var i = 0; i < patient.length; i++) {
                if (i == 0) {
                    htmlstr += "<option value='ids,基本信息'>基本信息</option>";
                } else if (patient[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = patient[i].column_comment.indexOf("（");
                    var indexEnd = patient[i].column_comment.lastIndexOf("）");
                    var columnComment = patient[i].column_comment.substring(indexState, indexEnd + 1);
                    if( patient[i].columnName.indexOf("patient_name") !=-1 ){
                        htmlstr += "<option selected value='" + patient[i].columnName + "," + patient[i].column_comment.replace(columnComment, '') + "'>" + patient[i].column_comment.replace(columnComment, '') + "</option>";
                    }else if( patient[i].columnName.indexOf("number") !=-1 ){
                        htmlstr += "<option selected value='" + patient[i].columnName + "," + patient[i].column_comment.replace(columnComment, '') + "'>" + patient[i].column_comment.replace(columnComment, '') + "</option>";
                    }else{
                        htmlstr += "<option value='" + patient[i].columnName + "," + patient[i].column_comment.replace(columnComment, '') + "'>" + patient[i].column_comment.replace(columnComment, '') + "</option>";
                    }
                } else {
                    htmlstr += "<option value='" + patient[i].columnName + "," + patient[i].column_comment.replace('id', '') + "'>" + patient[i].column_comment.replace('id', '') + "</option>";
                }
            }
            $("#patient_id").append(htmlstr);
            $("#patient_id").selectpicker('refresh');     //需要刷新
            /**
             * 联系人
             */
            var patientsFamily = map.patientsFamily;
            var htmlstr1 = "";
            for (var i = 0; i < patientsFamily.length; i++) {
                if (i == 0) {
                    htmlstr1 += "<option value='ids,联系人'>联系人</option>";
                } else if (patientsFamily[i].column_comment.lastIndexOf("id") == -1) {
                    htmlstr1 += "<option value='" + patientsFamily[i].columnName + "," + patientsFamily[i].column_comment + "'>" + patientsFamily[i].column_comment + "</option>";
                } else {
                    if (patientsFamily[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlstr1 += "<option value='" + patientsFamily[i].columnName + "," + patientsFamily[i].column_comment.replace('id', '') + "'>" + patientsFamily[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#patient_id").append(htmlstr1);
            $("#patient_id").selectpicker('refresh');     //需要刷新
            /**
             * 证件
             */
            var certificate = map.certificate;
            var htmlstr2 = "";
            for (var i = 0; i < certificate.length; i++) {
                if (i == 0) {
                    htmlstr2 += "<option value='ids,证件'>证件</option>";
                } else if (certificate[i].column_comment.lastIndexOf("id") == -1) {
                    htmlstr2 += "<option value='" + certificate[i].columnName + "," + certificate[i].column_comment + "'>" + certificate[i].column_comment + "</option>";
                } else {
                    if (certificate[i].column_comment.indexOf("family_id") == -1 && certificate[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlstr2 += "<option value='" + certificate[i].columnName + "," + certificate[i].column_comment.replace('id', '') + "'>" + certificate[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#patient_id").append(htmlstr2);
            $("#patient_id").selectpicker('refresh');     //需要刷新

            /**
             * 临床诊断
             */
            var diagnosticInformationSheet = map.diagnosticInformationSheet;
            var htmlstr3 = "";
            for (var i = 0; i < diagnosticInformationSheet.length; i++) {
                if (i == 0) {
                    htmlstr3 += "<option value='ids,临床诊断'>临床诊断</option>";
                } else if (diagnosticInformationSheet[i].column_comment.lastIndexOf("id") == -1) {
                    htmlstr3 += "<option value='" + diagnosticInformationSheet[i].columnName + "," + diagnosticInformationSheet[i].column_comment + "'>" + diagnosticInformationSheet[i].column_comment + "</option>";
                } else {
                    if (diagnosticInformationSheet[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlstr3 += "<option value='" + diagnosticInformationSheet[i].columnName + "," + diagnosticInformationSheet[i].column_comment.replace('id', '') + "'>" + diagnosticInformationSheet[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#diagnosticInformationSheet_id").append(htmlstr3);
            $("#diagnosticInformationSheet_id").selectpicker('refresh');     //需要刷新

            /**
             * 评分表
             */
            var score = map.score;
            var htmlstr4 = "";
            for (var i = 0; i < score.length; i++) {
                if (i == 0) {
                    htmlstr4 += "<option value='ids,评分表'>评分表</option>";
                } else if (score[i].column_comment.lastIndexOf("id") == -1) {
                    htmlstr4 += "<option value='" + score[i].columnName + "," + score[i].column_comment + "'>" + score[i].column_comment + "</option>";
                } else {
                    htmlstr4 += "<option value='" + score[i].columnName + "," + score[i].column_comment.replace('id', '') + "'>" + score[i].column_comment.replace('id', '') + "</option>";
                }
            }
            $("#score_id").append(htmlstr4);
            $("#score_id").selectpicker('refresh');     //需要刷新


            /**
             * 体格检查，贫血
             */
            var anemia = map.anemia;
            var htmlstr6 = "";
            for (var i = 0; i < anemia.length; i++) {
                if (i == 0) {
                    htmlstr6 += "<option value='ids,体格检查'>体格检查</option>";
                } else if (anemia[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = anemia[i].column_comment.indexOf("（");
                    var indexEnd = anemia[i].column_comment.lastIndexOf("）");
                    var columnComment = anemia[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlstr6 += "<option value='" + anemia[i].columnName + "," + anemia[i].column_comment.replace(columnComment, '') + "'>" + anemia[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (anemia[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlstr6 += "<option value='" + anemia[i].columnName + "," + anemia[i].column_comment.replace('id', '') + "'>" + anemia[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#anemia_id").append(htmlstr6);
            $("#anemia_id").selectpicker('refresh');     //需要刷新

            /**
             * 体格检查，体征血
             */
            var signsOfBlood = map.signsOfBlood;
            var htmlstr7 = "";
            for (var i = 0; i < signsOfBlood.length; i++) {
                if (i == 0) {
                    htmlstr7 += "<option value='ids,体征血'>体征血</option>";
                } else if (signsOfBlood[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = signsOfBlood[i].column_comment.indexOf("（");
                    var indexEnd = signsOfBlood[i].column_comment.lastIndexOf("）");
                    var columnComment = signsOfBlood[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlstr7 += "<option value='" + signsOfBlood[i].columnName + "," + signsOfBlood[i].column_comment.replace(columnComment, '') + "'>" + signsOfBlood[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (signsOfBlood[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlstr7 += "<option value='" + signsOfBlood[i].columnName + "," + signsOfBlood[i].column_comment.replace('id', '') + "'>" + signsOfBlood[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#anemia_id").append(htmlstr7);
            $("#anemia_id").selectpicker('refresh');     //需要刷新

            /**
             * 既往史，治疗史
             */
            var medicalHistory = map.medicalHistory;
            var htmlstr8 = "";
            for (var i = 0; i < medicalHistory.length; i++) {
                if (i == 0) {
                    htmlstr8 += "<option value='ids,既往史'>既往史</option>";
                } else if (medicalHistory[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = medicalHistory[i].column_comment.indexOf("（");
                    var indexEnd = medicalHistory[i].column_comment.lastIndexOf("）");
                    var columnComment = medicalHistory[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlstr8 += "<option value='" + medicalHistory[i].columnName + "," + medicalHistory[i].column_comment.replace(columnComment, '') + "'>" + medicalHistory[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (medicalHistory[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlstr8 += "<option value='" + medicalHistory[i].columnName + "," + medicalHistory[i].column_comment.replace('id', '') + "'>" + medicalHistory[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#medicalHistory_id").append(htmlstr8);
            $("#medicalHistory_id").selectpicker('refresh');     //需要刷新

            /**
             * 实验室检查，化学物质接触式
             */
            var chemicalExposureHistory = map.chemicalExposureHistory;
            var htmlstr9 = "";
            for (var i = 0; i < chemicalExposureHistory.length; i++) {
                if (i == 0) {
                    htmlstr9 += "<option value='ids,实验室检查'>实验室检查</option>";
                } else if (chemicalExposureHistory[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = chemicalExposureHistory[i].column_comment.indexOf("（");
                    var indexEnd = chemicalExposureHistory[i].column_comment.lastIndexOf("）");
                    var columnComment = chemicalExposureHistory[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlstr9 += "<option value='" + chemicalExposureHistory[i].columnName + "," + chemicalExposureHistory[i].column_comment.replace(columnComment, '') + "'>" + chemicalExposureHistory[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (chemicalExposureHistory[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlstr9 += "<option value='" + chemicalExposureHistory[i].columnName + "," + chemicalExposureHistory[i].column_comment.replace('id', '') + "'>" + chemicalExposureHistory[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#chemicalExposureHistory_id").append(htmlstr9);
            $("#chemicalExposureHistory_id").selectpicker('refresh');     //需要刷新

            /**
             * 影像学检查，胸部影像学
             */
            var chestImaging = map.chestImaging;
            var htmlstrChestImaging = "";
            for (var i = 0; i < chestImaging.length; i++) {
                if (i == 0) {
                    htmlstrChestImaging += "<option value='ids,胸部影像学'>胸部影像学</option>";
                } else if (chestImaging[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = chestImaging[i].column_comment.indexOf("（");
                    var indexEnd = chestImaging[i].column_comment.lastIndexOf("）");
                    var columnComment = chestImaging[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlstrChestImaging += "<option value='" + chestImaging[i].columnName + "," + chestImaging[i].column_comment.replace(columnComment, '') + "'>" + chestImaging[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (chestImaging[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlstrChestImaging += "<option value='" + chestImaging[i].columnName + "," + chestImaging[i].column_comment.replace('id', '') + "'>" + chestImaging[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#chestImaging_id").append(htmlstrChestImaging);
            $("#chestImaging_id").selectpicker('refresh');     //需要刷新

            /**
             * 用药,麻醉
             */
            var anesthesiaInformation = map.anesthesiaInformation;
            var htmlAnesthesiaInformation = "";
            for (var i = 0; i < anesthesiaInformation.length; i++) {
                if (i == 0) {
                    htmlAnesthesiaInformation += "<option value='ids,麻醉'>麻醉</option>";
                } else if (anesthesiaInformation[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = anesthesiaInformation[i].column_comment.indexOf("（");
                    var indexEnd = anesthesiaInformation[i].column_comment.lastIndexOf("）");
                    var columnComment = anesthesiaInformation[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlAnesthesiaInformation += "<option value='" + anesthesiaInformation[i].columnName + "," + anesthesiaInformation[i].column_comment.replace(columnComment, '') + "'>" + anesthesiaInformation[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    htmlAnesthesiaInformation += "<option value='" + anesthesiaInformation[i].columnName + "," + anesthesiaInformation[i].column_comment.replace('id', '') + "'>" + anesthesiaInformation[i].column_comment.replace('id', '') + "</option>";
                }
            }
            $("#medication_id").append(htmlAnesthesiaInformation);
            $("#medication_id").selectpicker('refresh');     //需要刷新

            /**
             * 用药,健康状态-输血信息
             */
            var bloodTransfusionRecord = map.bloodTransfusionRecord;
            var htmlBloodTransfusionRecord = "";
            for (var i = 0; i < bloodTransfusionRecord.length; i++) {
                if (i == 0) {
                    htmlBloodTransfusionRecord += "<option value='ids,输血'>输血</option>";
                } else if (bloodTransfusionRecord[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = bloodTransfusionRecord[i].column_comment.indexOf("（");
                    var indexEnd = bloodTransfusionRecord[i].column_comment.lastIndexOf("）");
                    var columnComment = bloodTransfusionRecord[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlBloodTransfusionRecord += "<option value='" + bloodTransfusionRecord[i].columnName + "," + bloodTransfusionRecord[i].column_comment.replace(columnComment, '') + "'>" + bloodTransfusionRecord[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (bloodTransfusionRecord[i].column_comment.indexOf("patientInformationSheet_id") == -1) {
                    } else {
                        htmlBloodTransfusionRecord += "<option value='" + bloodTransfusionRecord[i].columnName + "," + bloodTransfusionRecord[i].column_comment.replace('id', '') + "'>" + bloodTransfusionRecord[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#medication_id").append(htmlBloodTransfusionRecord);
            $("#medication_id").selectpicker('refresh');     //需要刷新

            /**
             * 用药
             */
            var medicalInformation = map.medicalInformation;
            var htmlMedicalInformation = "";
            for (var i = 0; i < medicalInformation.length; i++) {
                if (i == 0) {
                    htmlMedicalInformation += "<option value='ids,用药'>用药</option>";
                } else if (medicalInformation[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = medicalInformation[i].column_comment.indexOf("（");
                    var indexEnd = medicalInformation[i].column_comment.lastIndexOf("）");
                    var columnComment = medicalInformation[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlMedicalInformation += "<option value='" + medicalInformation[i].columnName + "," + medicalInformation[i].column_comment.replace(columnComment, '') + "'>" + medicalInformation[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (medicalInformation[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlMedicalInformation += "<option value='" + medicalInformation[i].columnName + "," + medicalInformation[i].column_comment.replace('id', '') + "'>" + medicalInformation[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#medication_id").append(htmlMedicalInformation);
            $("#medication_id").selectpicker('refresh');     //需要刷新

            /**
             * 临床诊断,肺转移
             */
            var pulmonaryMetastasis = map.pulmonaryMetastasis;
            var htmlPulmonaryMetastasis = "";
            for (var i = 0; i < pulmonaryMetastasis.length; i++) {
                if (i == 0) {
                    htmlPulmonaryMetastasis += "<option value='ids,肺转移'>肺转移</option>";
                } else if (pulmonaryMetastasis[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = pulmonaryMetastasis[i].column_comment.indexOf("（");
                    var indexEnd = pulmonaryMetastasis[i].column_comment.lastIndexOf("）");
                    var columnComment = pulmonaryMetastasis[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlPulmonaryMetastasis += "<option value='" + pulmonaryMetastasis[i].columnName + "," + pulmonaryMetastasis[i].column_comment.replace(columnComment, '') + "'>" + pulmonaryMetastasis[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (pulmonaryMetastasis[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlPulmonaryMetastasis += "<option value='" + pulmonaryMetastasis[i].columnName + "," + pulmonaryMetastasis[i].column_comment.replace('id', '') + "'>" + pulmonaryMetastasis[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#diagnosticInformationSheet_id").append(htmlPulmonaryMetastasis);
            $("#diagnosticInformationSheet_id").selectpicker('refresh');     //需要刷新

            /**
             * 临床诊断,肺部疾病
             */
            var tumorDiseaseHistory = map.tumorDiseaseHistory;
            var htmlTumorDiseaseHistory = "";
            for (var i = 0; i < tumorDiseaseHistory.length; i++) {
                if (i == 0) {
                    htmlTumorDiseaseHistory += "<option value='ids,肺部疾病'>肺部疾病</option>";
                } else if (tumorDiseaseHistory[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = tumorDiseaseHistory[i].column_comment.indexOf("（");
                    var indexEnd = tumorDiseaseHistory[i].column_comment.lastIndexOf("）");
                    var columnComment = tumorDiseaseHistory[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlTumorDiseaseHistory += "<option value='" + tumorDiseaseHistory[i].columnName + "," + tumorDiseaseHistory[i].column_comment.replace(columnComment, '') + "'>" + tumorDiseaseHistory[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (tumorDiseaseHistory[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlTumorDiseaseHistory += "<option value='" + tumorDiseaseHistory[i].columnName + "," + tumorDiseaseHistory[i].column_comment.replace('id', '') + "'>" + tumorDiseaseHistory[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#diagnosticInformationSheet_id").append(htmlTumorDiseaseHistory);
            $("#diagnosticInformationSheet_id").selectpicker('refresh');     //需要刷新

            /**
             * 临床诊断,肿瘤
             */
            var tumorMarker = map.tumorMarker;
            var htmlTumorMarker = "";
            for (var i = 0; i < tumorMarker.length; i++) {
                if (i == 0) {
                    htmlTumorMarker += "<option value='ids,肿瘤'>肿瘤</option>";
                } else if (tumorMarker[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = tumorMarker[i].column_comment.indexOf("（");
                    var indexEnd = tumorMarker[i].column_comment.lastIndexOf("）");
                    var columnComment = tumorMarker[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlTumorMarker += "<option value='" + tumorMarker[i].columnName + "," + tumorMarker[i].column_comment.replace(columnComment, '') + "'>" + tumorMarker[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (tumorMarker[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlTumorMarker += "<option value='" + tumorMarker[i].columnName + "," + tumorMarker[i].column_comment.replace('id', '') + "'>" + tumorMarker[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#diagnosticInformationSheet_id").append(htmlTumorMarker);
            $("#diagnosticInformationSheet_id").selectpicker('refresh');     //需要刷新

            /**
             * 临床诊断,骨转移
             */
            var boneMetastases = map.boneMetastases;
            var htmlBoneMetastases = "";
            for (var i = 0; i < boneMetastases.length; i++) {
                if (i == 0) {
                    htmlBoneMetastases += "<option value='ids,骨转移'>骨转移</option>";
                } else if (boneMetastases[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = boneMetastases[i].column_comment.indexOf("（");
                    var indexEnd = boneMetastases[i].column_comment.lastIndexOf("）");
                    var columnComment = boneMetastases[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlBoneMetastases += "<option value='" + boneMetastases[i].columnName + "," + boneMetastases[i].column_comment.replace(columnComment, '') + "'>" + boneMetastases[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (boneMetastases[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlBoneMetastases += "<option value='" + boneMetastases[i].columnName + "," + boneMetastases[i].column_comment.replace('id', '') + "'>" + boneMetastases[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#diagnosticInformationSheet_id").append(htmlBoneMetastases);
            $("#diagnosticInformationSheet_id").selectpicker('refresh');     //需要刷新

            /**
             * 临床诊断,脑转移
             */
            var brainMetastases = map.brainMetastases;
            var htmlBrainMetastases = "";
            for (var i = 0; i < brainMetastases.length; i++) {
                if (i == 0) {
                    htmlBrainMetastases += "<option value='ids,脑转移'>脑转移</option>";
                } else if (brainMetastases[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = brainMetastases[i].column_comment.indexOf("（");
                    var indexEnd = brainMetastases[i].column_comment.lastIndexOf("）");
                    var columnComment = brainMetastases[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlBrainMetastases += "<option value='" + brainMetastases[i].columnName + "," + brainMetastases[i].column_comment.replace(columnComment, '') + "'>" + brainMetastases[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (brainMetastases[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlBrainMetastases += "<option value='" + brainMetastases[i].columnName + "," + brainMetastases[i].column_comment.replace('id', '') + "'>" + brainMetastases[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#diagnosticInformationSheet_id").append(htmlBrainMetastases);
            $("#diagnosticInformationSheet_id").selectpicker('refresh');     //需要刷新

            /**
             * 临床诊断,肝转移
             */
            var liverMetastasis = map.liverMetastasis;
            var htmlLiverMetastasis = "";
            for (var i = 0; i < liverMetastasis.length; i++) {
                if (i == 0) {
                    htmlLiverMetastasis += "<option value='ids,肝转移'>肝转移</option>";
                } else if (liverMetastasis[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = liverMetastasis[i].column_comment.indexOf("（");
                    var indexEnd = liverMetastasis[i].column_comment.lastIndexOf("）");
                    var columnComment = liverMetastasis[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlLiverMetastasis += "<option value='" + liverMetastasis[i].columnName + "," + liverMetastasis[i].column_comment.replace(columnComment, '') + "'>" + liverMetastasis[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (liverMetastasis[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlLiverMetastasis += "<option value='" + liverMetastasis[i].columnName + "," + liverMetastasis[i].column_comment.replace('id', '') + "'>" + liverMetastasis[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#diagnosticInformationSheet_id").append(htmlLiverMetastasis);
            $("#diagnosticInformationSheet_id").selectpicker('refresh');     //需要刷新

            /**
             * 临床诊断,淋巴结转移
             */
            var lymphNodeMetastasis = map.lymphNodeMetastasis;
            var htmlLymphNodeMetastasis = "";
            for (var i = 0; i < lymphNodeMetastasis.length; i++) {
                if (i == 0) {
                    htmlLymphNodeMetastasis += "<option value='ids,淋巴结转移'>淋巴结转移</option>";
                } else if (lymphNodeMetastasis[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = lymphNodeMetastasis[i].column_comment.indexOf("（");
                    var indexEnd = lymphNodeMetastasis[i].column_comment.lastIndexOf("）");
                    var columnComment = lymphNodeMetastasis[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlLymphNodeMetastasis += "<option value='" + lymphNodeMetastasis[i].columnName + "," + lymphNodeMetastasis[i].column_comment.replace(columnComment, '') + "'>" + lymphNodeMetastasis[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (lymphNodeMetastasis[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlLymphNodeMetastasis += "<option value='" + lymphNodeMetastasis[i].columnName + "," + lymphNodeMetastasis[i].column_comment.replace('id', '') + "'>" + lymphNodeMetastasis[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#diagnosticInformationSheet_id").append(htmlMedicalInformation);
            $("#diagnosticInformationSheet_id").selectpicker('refresh');     //需要刷新

            /**
             * 临床诊断,其他转移
             */
            var otherTransfer = map.otherTransfer;
            var htmlOtherTransfer = "";
            for (var i = 0; i < otherTransfer.length; i++) {
                if (i == 0) {
                    htmlOtherTransfer += "<option value='ids,其他转移'>其他转移</option>";
                } else if (otherTransfer[i].column_comment.lastIndexOf("id") == -1) {
                    var indexState = otherTransfer[i].column_comment.indexOf("（");
                    var indexEnd = otherTransfer[i].column_comment.lastIndexOf("）");
                    var columnComment = otherTransfer[i].column_comment.substring(indexState, indexEnd + 1);
                    htmlOtherTransfer += "<option value='" + otherTransfer[i].columnName + "," + otherTransfer[i].column_comment.replace(columnComment, '') + "'>" + otherTransfer[i].column_comment.replace(columnComment, '') + "</option>";
                } else {
                    if (otherTransfer[i].column_comment.indexOf("patient_id") == -1) {
                    } else {
                        htmlOtherTransfer += "<option value='" + otherTransfer[i].columnName + "," + otherTransfer[i].column_comment.replace('id', '') + "'>" + otherTransfer[i].column_comment.replace('id', '') + "</option>";
                    }
                }
            }
            $("#diagnosticInformationSheet_id").append(htmlOtherTransfer);
            $("#diagnosticInformationSheet_id").selectpicker('refresh');     //需要刷新

        }
    })

    /**
     *点击基本信息时，打上对勾则选中后面所有数据，去掉对勾则不选中后面所有信息
     */
    $("#patients_input").click(function () {
        if ($('#patients_input').is(':checked')) {
            $("#patient_id option").attr("selected", true);
        } else {
            $("#patient_id option").attr("selected", false);
        }
        $("#patient_id").selectpicker('refresh');     //需要刷新
    })

    /**
     *点击用药时，打上对勾则选中后面所有数据，去掉对勾则不选中后面所有信息
     */
    $("#medication_input").click(function () {
        if ($('#medication_input').is(':checked')) {
            $("#medication_id option").attr("selected", true);
        } else {
            $("#medication_id option").attr("selected", false);
        }
        $("#medication_id").selectpicker('refresh');     //需要刷新
    })

    /**
     *点击体格检查时，打上对勾则选中后面所有数据，去掉对勾则不选中后面所有信息
     */
    $("#anemia_input").click(function () {
        if ($('#anemia_input').is(':checked')) {
            $("#anemia_id option").attr("selected", true);
        } else {
            $("#anemia_id option").attr("selected", false);
        }
        $("#anemia_id").selectpicker('refresh');     //需要刷新
    })

    /**
     *点击既往史时，打上对勾则选中后面所有数据，去掉对勾则不选中后面所有信息
     */
    $("#medicalHistory_input").click(function () {
        if ($('#medicalHistory_input').is(':checked')) {
            $("#medicalHistory_id option").attr("selected", true);
        } else {
            $("#medicalHistory_id option").attr("selected", false);
        }
        $("#medicalHistory_id").selectpicker('refresh');     //需要刷新
    })

    /**
     *点击实验室检查时，打上对勾则选中后面所有数据，去掉对勾则不选中后面所有信息
     */
    $("#chemicalExposureHistory_input").click(function () {
        if ($('#chemicalExposureHistory_input').is(':checked')) {
            $("#chemicalExposureHistory_id option").attr("selected", true);
        } else {
            $("#chemicalExposureHistory_id option").attr("selected", false);
        }
        $("#chemicalExposureHistory_id").selectpicker('refresh');     //需要刷新
    })

    /**
     *点击临床诊断时，打上对勾则选中后面所有数据，去掉对勾则不选中后面所有信息
     */
    $("#diagnosticInformationSheet_input").click(function () {
        if ($('#diagnosticInformationSheet_input').is(':checked')) {
            $("#diagnosticInformationSheet_id option").attr("selected", true);
        } else {
            $("#diagnosticInformationSheet_id option").attr("selected", false);
        }
        $("#diagnosticInformationSheet_id").selectpicker('refresh');     //需要刷新
    })

    /**
     *点击影像学检查时，打上对勾则选中后面所有数据，去掉对勾则不选中后面所有信息
     */
    $("#chestImaging_input").click(function () {
        if ($('#chestImaging_input').is(':checked')) {
            $("#chestImaging_id option").attr("selected", true);
        } else {
            $("#chestImaging_id option").attr("selected", false);
        }
        $("#chestImaging_id").selectpicker('refresh');     //需要刷新
    })

    /**
     *点击评分表时，打上对勾则选中后面所有数据，去掉对勾则不选中后面所有信息
     */
    $("#score_input").click(function () {
        if ($('#score_input').is(':checked')) {
            $("#score_id option").attr("selected", true);
        } else {
            $("#score_id option").attr("selected", false);
        }
        $("#score_id").selectpicker('refresh');     //需要刷新
    })

})